package com.dgty.dg_common.widget

import android.opengl.Visibility
import android.view.View
import com.blankj.utilcode.util.LogUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.dgty.dg_common.R
import com.dgty.dg_common.bean.ValueBean

/**
 * Title: ScaleAdapterBlue.kt
 * Description:
 * Created DateTime: 2023-03-22
 * Created by xxl.
 */
class ScaleAdapterBlue : BaseQuickAdapter<ValueBean, BaseViewHolder>(R.layout.item_set_info_scale) {

    override fun convert(holder: BaseViewHolder, item: ValueBean) {
        LogUtils.d("xxldata", "datasize:" + data.size)
        if (item.check) {
            holder.setBackgroundResource(R.id.view_scale, R.color.color_FF0FDDC3)
            holder.setTextColorRes(R.id.tv_scale, R.color.color_FF0FDDC3)
        } else {
            holder.setBackgroundResource(R.id.view_scale, R.color.grey3)
            holder.setTextColorRes(R.id.tv_scale, R.color.grey3)
        }
        holder.setVisible(R.id.tv_scale, true)
        holder.setText(R.id.tv_scale, item.value.toString())


        if (item.value == -1) {
            holder.itemView.visibility = View.INVISIBLE
        } else {
            holder.itemView.visibility = View.VISIBLE
        }

    }

}